home *** CD-ROM | disk | FTP | other *** search
/ Mission 3 / Mission 3.zip / Mission 3.iso / demovers / facevalu / examples / soundgen / userwork.lst < prev   
File List  |  1997-03-21  |  4KB  |  143 lines

  1. > PROCEDURE user_rsc_var_init
  2.   '
  3.   current_menubar&=menu&
  4.   animate_background_alert!=TRUE
  5.   animate_sound_off!=FALSE
  6.   '
  7.   DIM sgvordef_arr$(6)
  8.   DIM sgton_arr$(12)
  9.   LET sgton_var&=0
  10.   LET sgoktave_var&=4
  11.   DIM sgoption_arr$(6)
  12.   DIM sgoption_arr!(6)
  13.   LET sgform_var&=3
  14.   LET sgdauer_var$="70"
  15.   DIM sgvordef_ton&(6)
  16.   DIM sgvordef_oktave&(6)
  17.   DIM sgvordef_options|(6)
  18.   DIM sgvordef_form&(6)
  19.   DIM sgvordef_dauer&(6)
  20.   '
  21.   RESTORE vordef
  22.   CLR sgvordef_ndx&
  23.   DO
  24.     READ sgvordef_arr$(sgvordef_ndx&)
  25.     EXIT IF sgvordef_arr$(sgvordef_ndx&)="***"
  26.     READ sgvordef_ton&(sgvordef_ndx&)
  27.     READ sgvordef_oktave&(sgvordef_ndx&)
  28.     READ sgvordef_options|(sgvordef_ndx&)
  29.     READ sgvordef_form&(sgvordef_ndx&)
  30.     READ sgvordef_dauer&(sgvordef_ndx&)
  31.     INC sgvordef_ndx&
  32.   LOOP
  33. vordef:
  34.   DATA "Bell",9,7,&x000110,3,60
  35.   DATA "Helicopter",1,3,&x111001,8,8
  36.   DATA "Motorboat",1,2,&x111011,6,6
  37.   DATA "Alien",3,6,&x000111,8,90
  38.   DATA "***"
  39.   '
  40.   RESTORE ton
  41.   CLR sgton_ndx&
  42.   DO
  43.     READ sgton_arr$(sgton_ndx&)
  44.     EXIT IF sgton_arr$(sgton_ndx&)="***"
  45.     INC sgton_ndx&
  46.   LOOP
  47. ton:
  48.   DATA C,Cis,D,Dis,E,F,Fis,G,Gis,H,b,"***"
  49.   '
  50.   RESTORE option
  51.   CLR sgoption_ndx&
  52.   DO
  53.     READ sgoption_arr$(sgoption_ndx&)
  54.     EXIT IF sgoption_arr$(sgoption_ndx&)="***"
  55.     READ sgoption_arr!(sgoption_ndx&)
  56.     INC sgoption_ndx&
  57.   LOOP
  58. option:
  59.   DATA "PSG-soundchannel A",-1
  60.   DATA "PSG-soundchannel B",-1
  61.   DATA "PSG-soundchannel C",-1
  62.   DATA "rustle for A",0
  63.   DATA "rustle for B",0
  64.   DATA "rustle for C",0
  65.   DATA "***"
  66.   '
  67. RETURN
  68. > PROCEDURE user_rsc_interact(index&,tree&,object&,mc&,sub_me&)
  69.   '
  70.   '  <index&> is the index of this window in window_array&(index&,x)
  71.   '           If the object tree is the normal menu bar, <index&>=-1
  72.   '   <tree&> is the object tree number
  73.   ' <object&> is the object that was selected (clicked on OR shortcut)
  74.   '     <mc&> is the number of clicks (1=normal/2=double clicked/1 if shortcut)
  75.   ' <sub_me&> is the chosen menuitem in a popup menu
  76.   '
  77.   LOCAL set&,dauer&
  78.   '
  79.   SELECT tree&
  80.     '
  81.     ' ------------------------------------------------------------------------
  82.     '
  83.   CASE menu&
  84.     SELECT object&
  85.     CASE mmabout&
  86.       ~@alert_wind(1,alabout&,"")
  87.     CASE mmsoundg&
  88.       LET soundgen_window&=@win_open_dialog(2,soundgen&,-1)
  89.     CASE mmquit&
  90.       exit_program!=TRUE
  91.     ENDSELECT
  92.     '
  93.     ' ------------------------------------------------------------------------
  94.     '
  95.   CASE soundgen&
  96.     SELECT object&
  97.     CASE sgvordef&
  98.       LET set&=@listbox_menu(index&,object&,sgvordef_ndx&,sgvordef_arr$())
  99.       IF set&=>0
  100.         LET sgton_var&=sgvordef_ton&(set&)
  101.         LET sgoktave_var&=sgvordef_oktave&(set&)
  102.         BYTE{V:sgoption_arr!(0)}=sgvordef_options|(set&)
  103.         LET sgform_var&=sgvordef_form&(set&)
  104.         LET sgdauer_var$=STR$(sgvordef_dauer&(set&))
  105.         @rsc_ob_reset(soundgen&,0)
  106.       ENDIF
  107.     CASE sgton&
  108.       LET sgton_var&=@listbox_radio(index&,object&,sgton_var&,sgton_ndx&,sgton_arr$())
  109.     CASE sgoktave&
  110.     CASE sgoption&
  111.       @listbox_list(index&,object&,sgoption_ndx&,sgoption_arr$(),sgoption_arr!())
  112.     CASE sgform&
  113.     CASE sgdauer&
  114.     CASE sgplay&
  115.       ' Dur-Akkord spielen
  116.       SOUND 1,15,sgton_var&,sgoktave_var&
  117.       SOUND 2,15,ADD(sgton_var&,4),sgoktave_var&
  118.       SOUND 3,15,ADD(sgton_var&,7),sgoktave_var&
  119.       dauer&=ROUND((2-LOG10(101-VAL(sgdauer_var$)))*10000)
  120.       WAVE BYTE{V:sgoption_arr!(0)},7,sgform_var&+6,dauer&
  121.     CASE sgstop&
  122.       SOUND 1,0
  123.       SOUND 2,0
  124.       SOUND 3,0
  125.       WAVE 7,0
  126.     CASE sgok&
  127.       @win_close(soundgen_window&)
  128.     ENDSELECT
  129.     '
  130.     ' ------------------------------------------------------------------------
  131.     '
  132.   CASE fvt_altr&
  133.     alert_result&=SUB(object&,7)
  134.     @win_close(@find_handle_from_tree(fvt_altr&))
  135.     '
  136.     ' ------------------------------------------------------------------------
  137.     '
  138.     ' WRINKLES:
  139.     '
  140.     '
  141.   ENDSELECT
  142. RETURN
  143.